/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.ana.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author lucas.nunes
 */
@Entity
@Table(name = "QLTTB_PCD")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pcd.findAll", query = "SELECT p FROM Pcd p"),
    @NamedQuery(name = "Pcd.findByPcdId", query = "SELECT p FROM Pcd p WHERE p.pcdId = :pcdId"),
    @NamedQuery(name = "Pcd.findByPcdTxModelofabricante", query = "SELECT p FROM Pcd p WHERE p.pcdTxModelofabricante = :pcdTxModelofabricante"),
    @NamedQuery(name = "Pcd.findByPcdTxMarcafabricante", query = "SELECT p FROM Pcd p WHERE p.pcdTxMarcafabricante = :pcdTxMarcafabricante"),
    @NamedQuery(name = "Pcd.findByPcdDtInstalFis", query = "SELECT p FROM Pcd p WHERE p.pcdDtInstalFis = :pcdDtInstalFis"),
    @NamedQuery(name = "Pcd.findByPcdDtAtualizacao", query = "SELECT p FROM Pcd p WHERE p.pcdDtAtualizacao = :pcdDtAtualizacao"),
    @NamedQuery(name = "Pcd.findByPcdNmArqColetaAutom4", query = "SELECT p FROM Pcd p WHERE p.pcdNmArqColetaAutom4 = :pcdNmArqColetaAutom4"),
    @NamedQuery(name = "Pcd.findByPcdTxExtArqColetaAutom3", query = "SELECT p FROM Pcd p WHERE p.pcdTxExtArqColetaAutom3 = :pcdTxExtArqColetaAutom3"),
    @NamedQuery(name = "Pcd.findByPcdNmArqRetrieve", query = "SELECT p FROM Pcd p WHERE p.pcdNmArqRetrieve = :pcdNmArqRetrieve"),
    @NamedQuery(name = "Pcd.findByPcdTxExtArqRetrieve", query = "SELECT p FROM Pcd p WHERE p.pcdTxExtArqRetrieve = :pcdTxExtArqRetrieve"),
    @NamedQuery(name = "Pcd.findByPcdCdIgpontopoligono", query = "SELECT p FROM Pcd p WHERE p.pcdCdIgpontopoligono = :pcdCdIgpontopoligono"),
    @NamedQuery(name = "Pcd.findByPcdCdIgpontolinha", query = "SELECT p FROM Pcd p WHERE p.pcdCdIgpontolinha = :pcdCdIgpontolinha"),
    @NamedQuery(name = "Pcd.findByPcdCdIggeometria", query = "SELECT p FROM Pcd p WHERE p.pcdCdIggeometria = :pcdCdIggeometria")})
public class Pcd implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "PCD_ID")
    private BigDecimal pcdId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 104)
    @Column(name = "PCD_TX_MODELOFABRICANTE")
    private String pcdTxModelofabricante;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 104)
    @Column(name = "PCD_TX_MARCAFABRICANTE")
    private String pcdTxMarcafabricante;
    @Column(name = "PCD_DT_INSTAL_FIS")
    @Temporal(TemporalType.TIMESTAMP)
    private Date pcdDtInstalFis;
    @Basic(optional = false)
    @NotNull
    @Column(name = "PCD_DT_ATUALIZACAO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date pcdDtAtualizacao;
    @Size(max = 204)
    @Column(name = "PCD_NM_ARQ_COLETA_AUTOM4")
    private String pcdNmArqColetaAutom4;
    @Size(max = 14)
    @Column(name = "PCD_TX_EXT_ARQ_COLETA_AUTOM3")
    private String pcdTxExtArqColetaAutom3;
    @Size(max = 204)
    @Column(name = "PCD_NM_ARQ_RETRIEVE")
    private String pcdNmArqRetrieve;
    @Size(max = 14)
    @Column(name = "PCD_TX_EXT_ARQ_RETRIEVE")
    private String pcdTxExtArqRetrieve;
    @Column(name = "PCD_CD_IGPONTOPOLIGONO")
    private BigInteger pcdCdIgpontopoligono;
    @Column(name = "PCD_CD_IGPONTOLINHA")
    private BigInteger pcdCdIgpontolinha;
    @Column(name = "PCD_CD_IGGEOMETRIA")
    private BigInteger pcdCdIggeometria;
    @JoinColumn(name = "PCD_OGU_OPERADOR", referencedColumnName = "OGU_ID")
    @ManyToOne(optional = false)
    private OrgaoUnidade pcdOguOperador;
    @JoinColumn(name = "PCD_OGU_RESPONSAVEL", referencedColumnName = "OGU_ID")
    @ManyToOne(optional = false)
    private OrgaoUnidade pcdOguResponsavel;
    @JoinColumn(name = "PCD_EST_ID", referencedColumnName = "EST_ID")
    @ManyToOne(optional = false)
    private Estacao pcdEstId;
    @OneToMany(mappedBy = "cvhPcdId")
    private List<CaracterizacaoVhm> caracterizacaoVhmList;

    public Pcd() {
    }

    public Pcd(BigDecimal pcdId) {
        this.pcdId = pcdId;
    }

    public Pcd(BigDecimal pcdId, String pcdTxModelofabricante, String pcdTxMarcafabricante, Date pcdDtAtualizacao) {
        this.pcdId = pcdId;
        this.pcdTxModelofabricante = pcdTxModelofabricante;
        this.pcdTxMarcafabricante = pcdTxMarcafabricante;
        this.pcdDtAtualizacao = pcdDtAtualizacao;
    }

    public BigDecimal getPcdId() {
        return pcdId;
    }

    public void setPcdId(BigDecimal pcdId) {
        this.pcdId = pcdId;
    }

    public String getPcdTxModelofabricante() {
        return pcdTxModelofabricante;
    }

    public void setPcdTxModelofabricante(String pcdTxModelofabricante) {
        this.pcdTxModelofabricante = pcdTxModelofabricante;
    }

    public String getPcdTxMarcafabricante() {
        return pcdTxMarcafabricante;
    }

    public void setPcdTxMarcafabricante(String pcdTxMarcafabricante) {
        this.pcdTxMarcafabricante = pcdTxMarcafabricante;
    }

    public Date getPcdDtInstalFis() {
        return pcdDtInstalFis;
    }

    public void setPcdDtInstalFis(Date pcdDtInstalFis) {
        this.pcdDtInstalFis = pcdDtInstalFis;
    }

    public Date getPcdDtAtualizacao() {
        return pcdDtAtualizacao;
    }

    public void setPcdDtAtualizacao(Date pcdDtAtualizacao) {
        this.pcdDtAtualizacao = pcdDtAtualizacao;
    }

    public String getPcdNmArqColetaAutom4() {
        return pcdNmArqColetaAutom4;
    }

    public void setPcdNmArqColetaAutom4(String pcdNmArqColetaAutom4) {
        this.pcdNmArqColetaAutom4 = pcdNmArqColetaAutom4;
    }

    public String getPcdTxExtArqColetaAutom3() {
        return pcdTxExtArqColetaAutom3;
    }

    public void setPcdTxExtArqColetaAutom3(String pcdTxExtArqColetaAutom3) {
        this.pcdTxExtArqColetaAutom3 = pcdTxExtArqColetaAutom3;
    }

    public String getPcdNmArqRetrieve() {
        return pcdNmArqRetrieve;
    }

    public void setPcdNmArqRetrieve(String pcdNmArqRetrieve) {
        this.pcdNmArqRetrieve = pcdNmArqRetrieve;
    }

    public String getPcdTxExtArqRetrieve() {
        return pcdTxExtArqRetrieve;
    }

    public void setPcdTxExtArqRetrieve(String pcdTxExtArqRetrieve) {
        this.pcdTxExtArqRetrieve = pcdTxExtArqRetrieve;
    }

    public BigInteger getPcdCdIgpontopoligono() {
        return pcdCdIgpontopoligono;
    }

    public void setPcdCdIgpontopoligono(BigInteger pcdCdIgpontopoligono) {
        this.pcdCdIgpontopoligono = pcdCdIgpontopoligono;
    }

    public BigInteger getPcdCdIgpontolinha() {
        return pcdCdIgpontolinha;
    }

    public void setPcdCdIgpontolinha(BigInteger pcdCdIgpontolinha) {
        this.pcdCdIgpontolinha = pcdCdIgpontolinha;
    }

    public BigInteger getPcdCdIggeometria() {
        return pcdCdIggeometria;
    }

    public void setPcdCdIggeometria(BigInteger pcdCdIggeometria) {
        this.pcdCdIggeometria = pcdCdIggeometria;
    }

    public OrgaoUnidade getPcdOguOperador() {
        return pcdOguOperador;
    }

    public void setPcdOguOperador(OrgaoUnidade pcdOguOperador) {
        this.pcdOguOperador = pcdOguOperador;
    }

    public OrgaoUnidade getPcdOguResponsavel() {
        return pcdOguResponsavel;
    }

    public void setPcdOguResponsavel(OrgaoUnidade pcdOguResponsavel) {
        this.pcdOguResponsavel = pcdOguResponsavel;
    }

    public Estacao getPcdEstId() {
        return pcdEstId;
    }

    public void setPcdEstId(Estacao pcdEstId) {
        this.pcdEstId = pcdEstId;
    }

    @XmlTransient
    public List<CaracterizacaoVhm> getCaracterizacaoVhmList() {
        return caracterizacaoVhmList;
    }

    public void setCaracterizacaoVhmList(List<CaracterizacaoVhm> caracterizacaoVhmList) {
        this.caracterizacaoVhmList = caracterizacaoVhmList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pcdId != null ? pcdId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pcd)) {
            return false;
        }
        Pcd other = (Pcd) object;
        if ((this.pcdId == null && other.pcdId != null) || (this.pcdId != null && !this.pcdId.equals(other.pcdId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.gov.ana.service.Pcd[ pcdId=" + pcdId + " ]";
    }
    
}
